package com.tedu.pojo.controller;

import com.tedu.pojo.pojo.User;
import com.tedu.pojo.services.UserServices;
import com.tedu.pojo.services.UserServicesImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 处理与用户交互
 *
 */
public class UserController {

    //声明用户模块的服务层对象
    UserServices userServices = (UserServices) new UserServicesImpl();
    //吧对象UserServices交给spring管理

    @Autowired //从spring中取出来服务器
            UserServices us;

    public UserController() {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

    }
    //加载spring的配置文件,启动spring框架

    @RequestMapping("/login")
    public String login(User user) {
        User login = userServices.login(user);
        if (login == null) {
            //登录失败

            //登录成功
        }
        return "";
    }

}




